/********************
 * 指标拟定
 */
export const radioTwoList = [
  { value: '-1', name: '全部' },
  { value: '1', name: '本部' },
  { value: '0', name: '所属机构' }
]
import request from '@/router/axios'

// 查询指标拟定数据详情
export function targetDetail(id) {
  return request({
    url: `/appr-event/routineAssessKpi/${id}`,
    method: 'get',
  })
}

// 查询需要自己拟定填报的指标
export function targetNeedFill(kpiId) {
  return request({
    url: `/appr-event/routineAssessKpiDetail/fill/about/${kpiId}`,
    method: 'get',
  })
}

// 保存指标自己拟定的指标
export function saveFillTarget(data, participantId, type) {
  return request({
    url: `/appr-event/routineAssessKpiDetail/fill/about/${participantId}/${type}`,
    method: 'put',
    data: data
  })
}

// 拟定提交
export function palnSubmit(ids) {
  return request({
    url: `/appr-event/routineAssessKpi/process/sub/${ids}`,
    method: 'put',
  })
}

// 需要自己填报的指标查看
export function targetAllFill(kpiId) {
  return request({
    url: `/appr-event/routineAssessKpiDetail/fill/about/${kpiId}`,
    method: 'get',
  })
}
// 全量指标查看指标审核
export function targetAllFillIR(kpiId, taskId) {
  return request({
    url: `/appr-event/rckhKpiTaskList/fill/about/${kpiId}/${taskId}`,
    method: 'get',
  })
}
// 全量指标查看指标审核
export function targetAllFillIRTB(kpiId, taskId) {
  return request({
    url: `/appr-event/rckhKpiTaskList/fill/abouttb/${kpiId}/${taskId}`,
    method: 'get',
  })
}


// 指标评审提交审核
export function palnSubmitExamin(query) {
  return request({
    url: '/appr-event/routineAssessKpi/process/sub/audit',
    method: 'post',
    data: query
  })
}

// 查询拟定汇总中 指标的选项
export function indexDataList(kpiIds) {
  return request({
    url: `/appr-event/routineAssessKpiDetail/fill/abouts/${kpiIds}`,
    method: 'get',
  })
}
//查询拟定汇总中 指标列表
export function indexTabList(indexIds, itemIds) {
  return request({
    url: `/appr-event/routineAssessKpiDetail/fill/abouts/detail/${indexIds}/${itemIds}`,
    method: 'get',
  })
}

//查询拟定汇总中 指标列表--4/15新接口
export function newIndexTabList(kpiIds, itemIds) {
  return request({
    url: `/appr-event/routineAssessKpiDetail/item/collect/${kpiIds}/${itemIds}`,
    method: 'get',
  })
}
// 指标审核页面的拟定汇总 CheckBox查询--4/15
export function indexReviewDataList(kpiIds, taskIds) {
  return request({
    url: `/appr-event/routineAssessKpiDetail/item/audit/collect/${kpiIds}/${taskIds}`,
    method: 'get',
  })
}

// 指标审核页面的拟定汇总 表格查询--4/15
export function indexReviewTabList(kpiIds, taskIds) {
  return request({
    url: `/appr-event/routineAssessKpiDetail/item/audit/collect/detail/${kpiIds}/${taskIds}`,
    method: 'get',
  })
}
//指标拟定 结束
export function indexEnd(ids) {
  return request({
    url: `/appr-event/routineAssessKpi/process/sub/over/${ids}`,
    method: 'put',
  })
}


//查询指标评审中 指标的选项
export function indexExaminDataList(kpiIds) {
  return request({
    url: `/appr-event/routineAssessKpiDetail/fill/alls/${kpiIds} `,
    method: 'get',
  })
}

//查询全量指标
export function indexExaminAllDataList(id) {
  return request({
    url: `/appr-event/routineAssessKpiDetail/fill/all/${id} `,
    method: 'get',
  })
}
//查询指标评审中 指标列表
//查询拟定汇总中 指标列表
export function indexExaminTabList(indexIds, itemIds) {
  return request({
    url: `/appr-event/routineAssessKpiDetail/fill/abouts/detail/all/${indexIds}/${itemIds}`,
    method: 'get',
  })
}
export function newIndexExaminTabList(indexIds, itemIds) {
  return request({
    url: `/appr-event/routineAssessKpiDetail/item/collect/all/${indexIds}/${itemIds}`,
    method: 'get',
  })
}


// 指标审核页面的拟定汇总 CheckBox查询--4/15
export function indexReviewDataListNew(kpiIds, taskIds) {
  return request({
    url: `/appr-event/routineAssessKpiDetail/item/audit/collect/${kpiIds}/${taskIds}`,
    method: 'get',
  })
}

export function newIndexExaminTabListNew(kpiIds, itemIds) {
  return request({
    url: `/appr-event/routineAssessKpiDetail/item/collect/all/${kpiIds}/${itemIds}`,
    method: 'get',
  })
}

// /
//新增2022/4/9
//
export function getDeptId(query) {
  return request({
    url: '/appr-event/rckhkpiacttemplate/getDeptId',
    method: 'get',
    data: query
  })
}
//指标拟定模板进来的获取数据
export function getUserForTemplate(query) {
  return request({
    url: '/appr-event/rckhkpiacttemplate/getUserForTemplate',
    method: 'get',
    params: query
  })
}
// isExsitTemplateName
export function isExsitTemplateNamejy(data) {
  return request({
    url: '/appr-event/rckhkpiacttemplate/isExsitTemplateName',
    method: 'post',
    data: data
  })
}

// 模板保存
export function saveTemplate(query) {
  return request({
    url: '/appr-event/rckhkpiacttemplate/saveTemplate',
    method: 'post',
    data: query
  })
}
//模板分页
export function getemPage(query) {
  return request({
    url: '/appr-event/rckhkpiacttemplate/page',
    method: 'get',
    params: query
  })
}
//模板删除
export function deleteBatch(query) {
  return request({
    url: '/appr-event/rckhkpiacttemplate/deleteBatch',
    method: 'get',
    params: query
  })
}

// 获取模板下拉
export function getListMb(query) {
  return request({
    url: '/appr-event/rckhkpiacttemplate/getList',
    method: 'get',
    params: query
  })
}


// 自定义流程提交
export function submitStatusAllfn(query) {
  return request({
    url: '/appr-event/routineAssessKpi/submitNdByTemplate',
    method: 'post',
    data: query
  })
}

export function submitNdByTemplate(query) {
  return request({
    url: '/appr-event/routineAssessKpi/submitNdByTemplate',
    method: 'post',
    data: query
  })
}
//获取模板下拉
export function getContractTypeDict(query) {
  return request({
    url: '/appr-event/rckhkpiacttemplate/getContractTypeDict',
    method: 'get',
    params: query
  })
}


// 所有树
export function alltree(query) {
  return request({
    url: '/appr-event/rckhtemplatemain/alltree',
    method: 'get',
    params: query
  })
}

// 提交
export function zbndshSubmit(query) {
  return request({
    url: '/appr-event/routineAssessKpiSubProcess/zbndshSubmit',
    method: 'post',
    data: query
  })
}

//指标拟订查询指标
export function isflagzhibiao(data) {
  return request({
    url: '/appr-event/routineAssessKpiSubProcess/isflagzhibiao',
    method: 'post',
    data: data
  })
}

//导出 指标审核by mingyue
export function exportExcel(query) {
  return request({
    url: `/appr-event/routineAssessKpi/itemprocess/exportExcel`,
    method: 'post',
    data: query,
    responseType: 'blob'
  })
}

//导出 指标评审 by mingyue
export function exportExcelExamin(query) {
  return request({
    url: `/appr-event/routineAssessKpi/itemprocess/exportExcel`,
    method: 'post',
    data: query,
    responseType: 'blob'
  })
}

// 指标审核子页面，指标同意/驳回
export function zbndZbSubmit(query) {
  return request({
    url: '/appr-event/routineAssessKpiSubProcess/zbndZbSubmit',
    method: 'post',
    data: query
  })
}


// 填报审核子页面，指标同意/驳回
export function jgtbZbSubmit(query) {
  return request({
    url: '/appr-event/routineAssessKpiSubProcess/jgtbZbSubmit',
    method: 'post',
    data: query
  })
}
// 按填报启动限制
export function judgeFalg(id) {
  return request({
    url: `/appr-event/routineAssess/getByIdno/${id}`,
    method: 'get'
  })
}

// 按填报启动限制
export function checkIsFill(query) {
  return request({
    url: `/appr-event/routineAssessKpi/checkIsFill`,
    method: 'get',
    params: query
  })
}
// 公式计算加入
export function zltest(itemId, finishValue) {
  return request({
    url: `/appr-event/routineAssessKpiDetail/calcuScore/${itemId}/${finishValue}`,
    method: 'get',
  })
}
// 公式计算加入
export function zltestAll(itemId,targetValue, finishValue) {
  return request({
    url: `/appr-event/routineAssessKpiDetail/calcuAllScore/${itemId}/${targetValue}/${finishValue}`,
    method: 'get',
  })
}

// 公式计算加入2
export function zltestAdd(itemId,targetValue,finishValue,weight) {
  return request({
    url: `/appr-event/routineAssessKpiDetail/calcuScoreCommon/${itemId}/${targetValue}/${finishValue}/${weight}`,
    method: 'get',
  })
}
// 验证指标是否重复
export function checkitem(assessParticipantId, normIds) {
  return request({
    url: `/appr-event/routineAssessKpiDetail/checkitem/${assessParticipantId}/${normIds}`,
    method: 'get',
  })
}




